package com.cskaoyan.controller.backgroundsystemcontroller;

import com.cskaoyan.bean.vo.*;
import com.cskaoyan.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: lds
 * @class: UserController
 */
@RestController
@RequestMapping("admin")
public class UserController {

    @Autowired
    UserService userService;

    /**
     * @author: 刘森飚
     * @title: userList
     * @description:
     * @param: [page, limit, sort, order, username, mobile]
     * @return: com.cskaoyan.bean.vo.WxBaseRespVo
     */
    @RequestMapping("user/list")
    public BaseRespVo userList(Integer page, Integer limit, String sort, String order,
                               String username, String mobile) {
        UserListVo userVo = userService.queryUsersData(page, limit, sort, order,
                username, mobile);

        return BaseRespVo.ok(userVo);


    }

    /**
     * @author: 刘森飚
     * @title: addressList
     * @description: page: 1
     * limit: 20
     * name: 1
     * userId: 1
     * sort: add_time
     * order: desc
     * @param: [page, limit, sort, order, name, userId]
     * @return: com.cskaoyan.bean.vo.WxBaseRespVo
     */
    @RequestMapping("address/list")
    public BaseRespVo addressList(Integer page, Integer limit, String sort, String order,
                                  String name, Integer userId) {


        UserAddressListVo1 userAddressListVo1 = userService.queryAddressesData(page, limit, sort, order, name, userId);

        return BaseRespVo.ok(userAddressListVo1);
    }
    /**
     * @author: 刘森飚
     * @title: collectList
     * @description:
     * @param: [page, limit, sort, order, userId, valueId]
     * @return: com.cskaoyan.bean.vo.WxBaseRespVo
     */
    @RequestMapping("collect/list")
    public BaseRespVo collectList(Integer page, Integer limit, String sort, String order, Integer valueId, Integer userId) {

        UserCollectVo userCollectVo = userService.querryCollectData(page, limit, sort, order, valueId, userId);

        return BaseRespVo.ok(userCollectVo);
    }
    /**
     * @author: 刘森飚
     * @title: footprintList
     * @description:
     * @param: [page, limit, sort, order, userId, goodsId]
     * @return: com.cskaoyan.bean.vo.WxBaseRespVo
     */

    @RequestMapping("footprint/list")
    public BaseRespVo footprintList(Integer page, Integer limit, String sort, String order, Integer userId, Integer goodsId) {

        UserFootPrintVo userFootPrintVo = userService.querryFootPrintData(page, limit, sort, order, userId, goodsId);

        return BaseRespVo.ok(userFootPrintVo);
    }
    /**
     * @author: 刘森飚
     * @title: historyList
     * @description:
     * @param: [page, limit, sort, order, userId, keyword]
     * @return: com.cskaoyan.bean.vo.WxBaseRespVo
     */

    @RequestMapping("history/list")
    public BaseRespVo historyList(Integer page, Integer limit, String sort, String order, String keyword, Integer userId) {

        UserHistoryVo userHistoryVo = userService.querryHistoryData(page, limit, sort, order, keyword, userId);
        return  BaseRespVo.ok(userHistoryVo);
    }

    /**
     * @author: 刘森飚
     * @title: feedbackList
     * @description:
     * @param: [page, limit, sort, order, username, id]
     * @return: com.cskaoyan.bean.vo.WxBaseRespVo
     */

    @RequestMapping("feedback/list")
    public BaseRespVo feedbackList(Integer page, Integer limit, String sort, String order, String username, Integer id) {
        UserFeedBackVo userFeedBackVo = userService.querryFeedBackData(page, limit, sort, order, username, id);

        return BaseRespVo.ok(userFeedBackVo);
    }
}



